<?php

/**
 * Retail Evolved - Facebook Like Button
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA that is bundled with this
 * package in the file EVOLVED_EULA.txt.
 * It is also available through the world-wide-web at this URL:
 * http://retailevolved.com/eula-1-0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to service@retailevolved.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * You may edit this file, but only at your own risk, as long as it is within
 * the constraints of the license agreement. Before upgrading the module (not Magento), 
 * be sure to back up your original installation as the upgrade may override your
 * changes.
 *
 * @category   Evolved
 * @package    Evolved_Like
 * @copyright  Copyright (c) 2010 Kaelex Inc. DBA Retail Evolved (http://retailevolved.com)
 * @license    http://retailevolved.com/eula-1-0 (Retail Evolved EULA 1.0)
 */

?>
<?php if(!Mage::helper('evlike')->getLikeConfig('ev_facebook_type')): ?>
	<?php 
		$_locale = Mage::app()->getLocale()->getLocaleCode(); 
		if($_locale != "en_AU" && $_locale != "en_HK" && $_locale != "en_NZ") {
			$_locale = Mage::app()->getLocale()->getLocaleCode();
		} else {
			$_locale = "en_US";
		}
	?>
<!-- Using the JavaScript SDK -->
<div id="fb-root"></div>

<script>
  window.fbAsyncInit = function() {
    FB.init({appId: '<?php echo Mage::helper("evlike")->getLikeConfig("ev_facebook_app_id") ?>',
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/<?php echo $_locale ?>/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>

<?php endif; ?>